

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>describe.data.element_data &mdash; describe 0.1.0 documentation</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/style.css" type="text/css" />
    <link rel="author" title="About these documents" href="../../../about.html" />
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" /> 

  
  <script src="../../../_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="../../../index.html" class="icon icon-home"> describe
          

          
          </a>

          
            
            
              <div class="version">
                0.1.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../../../install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorials/tutorials.html">Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../doc/modules.html">Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../about.html">About</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../index.html">describe</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../../index.html">Module code</a> &raquo;</li>
        
      <li>describe.data.element_data</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <h1>Source code for describe.data.element_data</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Used to store data related to atomic elements. Also has some conversion</span>
<span class="sd">utilities related to the data.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>

<span class="n">SYMBOL_TO_NUMBER_MAP</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;X&#39;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;H&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>  <span class="s1">&#39;He&#39;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;Li&#39;</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">&#39;Be&#39;</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
    <span class="s1">&#39;B&#39;</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>  <span class="s1">&#39;C&#39;</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span>  <span class="s1">&#39;N&#39;</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span>  <span class="s1">&#39;O&#39;</span><span class="p">:</span> <span class="mi">8</span><span class="p">,</span>  <span class="s1">&#39;F&#39;</span><span class="p">:</span> <span class="mi">9</span><span class="p">,</span>
    <span class="s1">&#39;Ne&#39;</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span> <span class="s1">&#39;Na&#39;</span><span class="p">:</span> <span class="mi">11</span><span class="p">,</span> <span class="s1">&#39;Mg&#39;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span> <span class="s1">&#39;Al&#39;</span><span class="p">:</span> <span class="mi">13</span><span class="p">,</span> <span class="s1">&#39;Si&#39;</span><span class="p">:</span> <span class="mi">14</span><span class="p">,</span>
    <span class="s1">&#39;P&#39;</span><span class="p">:</span> <span class="mi">15</span><span class="p">,</span>  <span class="s1">&#39;S&#39;</span><span class="p">:</span> <span class="mi">16</span><span class="p">,</span>  <span class="s1">&#39;Cl&#39;</span><span class="p">:</span> <span class="mi">17</span><span class="p">,</span> <span class="s1">&#39;Ar&#39;</span><span class="p">:</span> <span class="mi">18</span><span class="p">,</span> <span class="s1">&#39;K&#39;</span><span class="p">:</span> <span class="mi">19</span><span class="p">,</span>
    <span class="s1">&#39;Ca&#39;</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="s1">&#39;Sc&#39;</span><span class="p">:</span> <span class="mi">21</span><span class="p">,</span> <span class="s1">&#39;Ti&#39;</span><span class="p">:</span> <span class="mi">22</span><span class="p">,</span> <span class="s1">&#39;V&#39;</span><span class="p">:</span> <span class="mi">23</span><span class="p">,</span>  <span class="s1">&#39;Cr&#39;</span><span class="p">:</span> <span class="mi">24</span><span class="p">,</span>
    <span class="s1">&#39;Mn&#39;</span><span class="p">:</span> <span class="mi">25</span><span class="p">,</span> <span class="s1">&#39;Fe&#39;</span><span class="p">:</span> <span class="mi">26</span><span class="p">,</span> <span class="s1">&#39;Co&#39;</span><span class="p">:</span> <span class="mi">27</span><span class="p">,</span> <span class="s1">&#39;Ni&#39;</span><span class="p">:</span> <span class="mi">28</span><span class="p">,</span> <span class="s1">&#39;Cu&#39;</span><span class="p">:</span> <span class="mi">29</span><span class="p">,</span>
    <span class="s1">&#39;Zn&#39;</span><span class="p">:</span> <span class="mi">30</span><span class="p">,</span> <span class="s1">&#39;Ga&#39;</span><span class="p">:</span> <span class="mi">31</span><span class="p">,</span> <span class="s1">&#39;Ge&#39;</span><span class="p">:</span> <span class="mi">32</span><span class="p">,</span> <span class="s1">&#39;As&#39;</span><span class="p">:</span> <span class="mi">33</span><span class="p">,</span> <span class="s1">&#39;Se&#39;</span><span class="p">:</span> <span class="mi">34</span><span class="p">,</span>
    <span class="s1">&#39;Br&#39;</span><span class="p">:</span> <span class="mi">35</span><span class="p">,</span> <span class="s1">&#39;Kr&#39;</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span> <span class="s1">&#39;Rb&#39;</span><span class="p">:</span> <span class="mi">37</span><span class="p">,</span> <span class="s1">&#39;Sr&#39;</span><span class="p">:</span> <span class="mi">38</span><span class="p">,</span> <span class="s1">&#39;Y&#39;</span><span class="p">:</span> <span class="mi">39</span><span class="p">,</span>
    <span class="s1">&#39;Zr&#39;</span><span class="p">:</span> <span class="mi">40</span><span class="p">,</span> <span class="s1">&#39;Nb&#39;</span><span class="p">:</span> <span class="mi">41</span><span class="p">,</span> <span class="s1">&#39;Mo&#39;</span><span class="p">:</span> <span class="mi">42</span><span class="p">,</span> <span class="s1">&#39;Tc&#39;</span><span class="p">:</span> <span class="mi">43</span><span class="p">,</span> <span class="s1">&#39;Ru&#39;</span><span class="p">:</span> <span class="mi">44</span><span class="p">,</span>
    <span class="s1">&#39;Rh&#39;</span><span class="p">:</span> <span class="mi">45</span><span class="p">,</span> <span class="s1">&#39;Pd&#39;</span><span class="p">:</span> <span class="mi">46</span><span class="p">,</span> <span class="s1">&#39;Ag&#39;</span><span class="p">:</span> <span class="mi">47</span><span class="p">,</span> <span class="s1">&#39;Cd&#39;</span><span class="p">:</span> <span class="mi">48</span><span class="p">,</span> <span class="s1">&#39;In&#39;</span><span class="p">:</span> <span class="mi">49</span><span class="p">,</span>
    <span class="s1">&#39;Sn&#39;</span><span class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span class="s1">&#39;Sb&#39;</span><span class="p">:</span> <span class="mi">51</span><span class="p">,</span> <span class="s1">&#39;Te&#39;</span><span class="p">:</span> <span class="mi">52</span><span class="p">,</span> <span class="s1">&#39;I&#39;</span><span class="p">:</span> <span class="mi">53</span><span class="p">,</span>  <span class="s1">&#39;Xe&#39;</span><span class="p">:</span> <span class="mi">54</span><span class="p">,</span>
    <span class="s1">&#39;Cs&#39;</span><span class="p">:</span> <span class="mi">55</span><span class="p">,</span> <span class="s1">&#39;Ba&#39;</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span> <span class="s1">&#39;La&#39;</span><span class="p">:</span> <span class="mi">57</span><span class="p">,</span> <span class="s1">&#39;Ce&#39;</span><span class="p">:</span> <span class="mi">58</span><span class="p">,</span> <span class="s1">&#39;Pr&#39;</span><span class="p">:</span> <span class="mi">59</span><span class="p">,</span>
    <span class="s1">&#39;Nd&#39;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span> <span class="s1">&#39;Pm&#39;</span><span class="p">:</span> <span class="mi">61</span><span class="p">,</span> <span class="s1">&#39;Sm&#39;</span><span class="p">:</span> <span class="mi">62</span><span class="p">,</span> <span class="s1">&#39;Eu&#39;</span><span class="p">:</span> <span class="mi">63</span><span class="p">,</span> <span class="s1">&#39;Gd&#39;</span><span class="p">:</span> <span class="mi">64</span><span class="p">,</span>
    <span class="s1">&#39;Tb&#39;</span><span class="p">:</span> <span class="mi">65</span><span class="p">,</span> <span class="s1">&#39;Dy&#39;</span><span class="p">:</span> <span class="mi">66</span><span class="p">,</span> <span class="s1">&#39;Ho&#39;</span><span class="p">:</span> <span class="mi">67</span><span class="p">,</span> <span class="s1">&#39;Er&#39;</span><span class="p">:</span> <span class="mi">68</span><span class="p">,</span> <span class="s1">&#39;Tm&#39;</span><span class="p">:</span> <span class="mi">69</span><span class="p">,</span>
    <span class="s1">&#39;Yb&#39;</span><span class="p">:</span> <span class="mi">70</span><span class="p">,</span> <span class="s1">&#39;Lu&#39;</span><span class="p">:</span> <span class="mi">71</span><span class="p">,</span> <span class="s1">&#39;Hf&#39;</span><span class="p">:</span> <span class="mi">72</span><span class="p">,</span> <span class="s1">&#39;Ta&#39;</span><span class="p">:</span> <span class="mi">73</span><span class="p">,</span> <span class="s1">&#39;W&#39;</span><span class="p">:</span> <span class="mi">74</span><span class="p">,</span>
    <span class="s1">&#39;Re&#39;</span><span class="p">:</span> <span class="mi">75</span><span class="p">,</span> <span class="s1">&#39;Os&#39;</span><span class="p">:</span> <span class="mi">76</span><span class="p">,</span> <span class="s1">&#39;Ir&#39;</span><span class="p">:</span> <span class="mi">77</span><span class="p">,</span> <span class="s1">&#39;Pt&#39;</span><span class="p">:</span> <span class="mi">78</span><span class="p">,</span> <span class="s1">&#39;Au&#39;</span><span class="p">:</span> <span class="mi">79</span><span class="p">,</span>
    <span class="s1">&#39;Hg&#39;</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span> <span class="s1">&#39;Tl&#39;</span><span class="p">:</span> <span class="mi">81</span><span class="p">,</span> <span class="s1">&#39;Pb&#39;</span><span class="p">:</span> <span class="mi">82</span><span class="p">,</span> <span class="s1">&#39;Bi&#39;</span><span class="p">:</span> <span class="mi">83</span><span class="p">,</span> <span class="s1">&#39;Po&#39;</span><span class="p">:</span> <span class="mi">84</span><span class="p">,</span>
    <span class="s1">&#39;At&#39;</span><span class="p">:</span> <span class="mi">85</span><span class="p">,</span> <span class="s1">&#39;Rn&#39;</span><span class="p">:</span> <span class="mi">86</span><span class="p">,</span> <span class="s1">&#39;Fr&#39;</span><span class="p">:</span> <span class="mi">87</span><span class="p">,</span> <span class="s1">&#39;Ra&#39;</span><span class="p">:</span> <span class="mi">88</span><span class="p">,</span> <span class="s1">&#39;Ac&#39;</span><span class="p">:</span> <span class="mi">89</span><span class="p">,</span>
    <span class="s1">&#39;Th&#39;</span><span class="p">:</span> <span class="mi">90</span><span class="p">,</span> <span class="s1">&#39;Pa&#39;</span><span class="p">:</span> <span class="mi">91</span><span class="p">,</span> <span class="s1">&#39;U&#39;</span><span class="p">:</span> <span class="mi">92</span><span class="p">,</span>  <span class="s1">&#39;Np&#39;</span><span class="p">:</span> <span class="mi">93</span><span class="p">,</span> <span class="s1">&#39;Pu&#39;</span><span class="p">:</span> <span class="mi">94</span><span class="p">,</span>
    <span class="s1">&#39;Am&#39;</span><span class="p">:</span> <span class="mi">95</span><span class="p">,</span> <span class="s1">&#39;Cm&#39;</span><span class="p">:</span> <span class="mi">96</span><span class="p">,</span> <span class="s1">&#39;Bk&#39;</span><span class="p">:</span> <span class="mi">97</span><span class="p">,</span> <span class="s1">&#39;Cf&#39;</span><span class="p">:</span> <span class="mi">98</span><span class="p">,</span> <span class="s1">&#39;Es&#39;</span><span class="p">:</span> <span class="mi">99</span><span class="p">,</span>
    <span class="s1">&#39;Fm&#39;</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span> <span class="s1">&#39;Md&#39;</span><span class="p">:</span> <span class="mi">101</span><span class="p">,</span> <span class="s1">&#39;No&#39;</span><span class="p">:</span> <span class="mi">102</span><span class="p">,</span> <span class="s1">&#39;Lr&#39;</span><span class="p">:</span> <span class="mi">103</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">NUMBER_TO_SYMBOL_MAP</span> <span class="o">=</span> <span class="p">[</span>
    <span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="s1">&#39;H&#39;</span><span class="p">,</span>  <span class="s1">&#39;He&#39;</span><span class="p">,</span> <span class="s1">&#39;Li&#39;</span><span class="p">,</span> <span class="s1">&#39;Be&#39;</span><span class="p">,</span>
    <span class="s1">&#39;B&#39;</span><span class="p">,</span>  <span class="s1">&#39;C&#39;</span><span class="p">,</span>  <span class="s1">&#39;N&#39;</span><span class="p">,</span>  <span class="s1">&#39;O&#39;</span><span class="p">,</span>  <span class="s1">&#39;F&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Ne&#39;</span><span class="p">,</span> <span class="s1">&#39;Na&#39;</span><span class="p">,</span> <span class="s1">&#39;Mg&#39;</span><span class="p">,</span> <span class="s1">&#39;Al&#39;</span><span class="p">,</span> <span class="s1">&#39;Si&#39;</span><span class="p">,</span>
    <span class="s1">&#39;P&#39;</span><span class="p">,</span>  <span class="s1">&#39;S&#39;</span><span class="p">,</span>  <span class="s1">&#39;Cl&#39;</span><span class="p">,</span> <span class="s1">&#39;Ar&#39;</span><span class="p">,</span> <span class="s1">&#39;K&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Ca&#39;</span><span class="p">,</span> <span class="s1">&#39;Sc&#39;</span><span class="p">,</span> <span class="s1">&#39;Ti&#39;</span><span class="p">,</span> <span class="s1">&#39;V&#39;</span><span class="p">,</span>  <span class="s1">&#39;Cr&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Mn&#39;</span><span class="p">,</span> <span class="s1">&#39;Fe&#39;</span><span class="p">,</span> <span class="s1">&#39;Co&#39;</span><span class="p">,</span> <span class="s1">&#39;Ni&#39;</span><span class="p">,</span> <span class="s1">&#39;Cu&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Zn&#39;</span><span class="p">,</span> <span class="s1">&#39;Ga&#39;</span><span class="p">,</span> <span class="s1">&#39;Ge&#39;</span><span class="p">,</span> <span class="s1">&#39;As&#39;</span><span class="p">,</span> <span class="s1">&#39;Se&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Br&#39;</span><span class="p">,</span> <span class="s1">&#39;Kr&#39;</span><span class="p">,</span> <span class="s1">&#39;Rb&#39;</span><span class="p">,</span> <span class="s1">&#39;Sr&#39;</span><span class="p">,</span> <span class="s1">&#39;Y&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Zr&#39;</span><span class="p">,</span> <span class="s1">&#39;Nb&#39;</span><span class="p">,</span> <span class="s1">&#39;Mo&#39;</span><span class="p">,</span> <span class="s1">&#39;Tc&#39;</span><span class="p">,</span> <span class="s1">&#39;Ru&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Rh&#39;</span><span class="p">,</span> <span class="s1">&#39;Pd&#39;</span><span class="p">,</span> <span class="s1">&#39;Ag&#39;</span><span class="p">,</span> <span class="s1">&#39;Cd&#39;</span><span class="p">,</span> <span class="s1">&#39;In&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Sn&#39;</span><span class="p">,</span> <span class="s1">&#39;Sb&#39;</span><span class="p">,</span> <span class="s1">&#39;Te&#39;</span><span class="p">,</span> <span class="s1">&#39;I&#39;</span><span class="p">,</span>  <span class="s1">&#39;Xe&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Cs&#39;</span><span class="p">,</span> <span class="s1">&#39;Ba&#39;</span><span class="p">,</span> <span class="s1">&#39;La&#39;</span><span class="p">,</span> <span class="s1">&#39;Ce&#39;</span><span class="p">,</span> <span class="s1">&#39;Pr&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Nd&#39;</span><span class="p">,</span> <span class="s1">&#39;Pm&#39;</span><span class="p">,</span> <span class="s1">&#39;Sm&#39;</span><span class="p">,</span> <span class="s1">&#39;Eu&#39;</span><span class="p">,</span> <span class="s1">&#39;Gd&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Tb&#39;</span><span class="p">,</span> <span class="s1">&#39;Dy&#39;</span><span class="p">,</span> <span class="s1">&#39;Ho&#39;</span><span class="p">,</span> <span class="s1">&#39;Er&#39;</span><span class="p">,</span> <span class="s1">&#39;Tm&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Yb&#39;</span><span class="p">,</span> <span class="s1">&#39;Lu&#39;</span><span class="p">,</span> <span class="s1">&#39;Hf&#39;</span><span class="p">,</span> <span class="s1">&#39;Ta&#39;</span><span class="p">,</span> <span class="s1">&#39;W&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Re&#39;</span><span class="p">,</span> <span class="s1">&#39;Os&#39;</span><span class="p">,</span> <span class="s1">&#39;Ir&#39;</span><span class="p">,</span> <span class="s1">&#39;Pt&#39;</span><span class="p">,</span> <span class="s1">&#39;Au&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Hg&#39;</span><span class="p">,</span> <span class="s1">&#39;Tl&#39;</span><span class="p">,</span> <span class="s1">&#39;Pb&#39;</span><span class="p">,</span> <span class="s1">&#39;Bi&#39;</span><span class="p">,</span> <span class="s1">&#39;Po&#39;</span><span class="p">,</span>
    <span class="s1">&#39;At&#39;</span><span class="p">,</span> <span class="s1">&#39;Rn&#39;</span><span class="p">,</span> <span class="s1">&#39;Fr&#39;</span><span class="p">,</span> <span class="s1">&#39;Ra&#39;</span><span class="p">,</span> <span class="s1">&#39;Ac&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Th&#39;</span><span class="p">,</span> <span class="s1">&#39;Pa&#39;</span><span class="p">,</span> <span class="s1">&#39;U&#39;</span><span class="p">,</span>  <span class="s1">&#39;Np&#39;</span><span class="p">,</span> <span class="s1">&#39;Pu&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Am&#39;</span><span class="p">,</span> <span class="s1">&#39;Cm&#39;</span><span class="p">,</span> <span class="s1">&#39;Bk&#39;</span><span class="p">,</span> <span class="s1">&#39;Cf&#39;</span><span class="p">,</span> <span class="s1">&#39;Es&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Fm&#39;</span><span class="p">,</span> <span class="s1">&#39;Md&#39;</span><span class="p">,</span> <span class="s1">&#39;No&#39;</span><span class="p">,</span> <span class="s1">&#39;Lr&#39;</span>
<span class="p">]</span>

<span class="sd">&quot;&quot;&quot;List of atomic names in order.&quot;&quot;&quot;</span>
<span class="n">NUMBER_TO_NAME_MAP</span> <span class="o">=</span> <span class="p">[</span>
    <span class="s1">&#39;Ghost&#39;</span><span class="p">,</span>   <span class="s1">&#39;Hydrogen&#39;</span><span class="p">,</span>  <span class="s1">&#39;Helium&#39;</span><span class="p">,</span> <span class="s1">&#39;Lithium&#39;</span><span class="p">,</span> <span class="s1">&#39;Beryllium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Boron&#39;</span><span class="p">,</span>  <span class="s1">&#39;Carbon&#39;</span><span class="p">,</span>  <span class="s1">&#39;Nitrogen&#39;</span><span class="p">,</span>  <span class="s1">&#39;Oxygen&#39;</span><span class="p">,</span>  <span class="s1">&#39;Fluorine&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Neon&#39;</span><span class="p">,</span> <span class="s1">&#39;Sodium&#39;</span><span class="p">,</span> <span class="s1">&#39;Magnesium&#39;</span><span class="p">,</span> <span class="s1">&#39;Aluminum&#39;</span><span class="p">,</span> <span class="s1">&#39;Silicon&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Phosphorus&#39;</span><span class="p">,</span>  <span class="s1">&#39;Sulfur&#39;</span><span class="p">,</span>  <span class="s1">&#39;Chlorine&#39;</span><span class="p">,</span> <span class="s1">&#39;Argon&#39;</span><span class="p">,</span> <span class="s1">&#39;Potassium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Calcium&#39;</span><span class="p">,</span> <span class="s1">&#39;Scandium&#39;</span><span class="p">,</span> <span class="s1">&#39;Titanium&#39;</span><span class="p">,</span> <span class="s1">&#39;Vanadium&#39;</span><span class="p">,</span>  <span class="s1">&#39;Chromium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Manganese&#39;</span><span class="p">,</span> <span class="s1">&#39;Iron&#39;</span><span class="p">,</span> <span class="s1">&#39;Cobalt&#39;</span><span class="p">,</span> <span class="s1">&#39;Nickel&#39;</span><span class="p">,</span> <span class="s1">&#39;Copper&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Zinc&#39;</span><span class="p">,</span> <span class="s1">&#39;Gallium&#39;</span><span class="p">,</span> <span class="s1">&#39;Germanium&#39;</span><span class="p">,</span> <span class="s1">&#39;Arsenic&#39;</span><span class="p">,</span> <span class="s1">&#39;Selenium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Bromine&#39;</span><span class="p">,</span> <span class="s1">&#39;Krypton&#39;</span><span class="p">,</span> <span class="s1">&#39;Rubidium&#39;</span><span class="p">,</span> <span class="s1">&#39;Strontium&#39;</span><span class="p">,</span> <span class="s1">&#39;Yttrium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Zirconium&#39;</span><span class="p">,</span> <span class="s1">&#39;Niobium&#39;</span><span class="p">,</span> <span class="s1">&#39;Molybdenum&#39;</span><span class="p">,</span> <span class="s1">&#39;Technetium&#39;</span><span class="p">,</span> <span class="s1">&#39;Ruthenium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Rhodium&#39;</span><span class="p">,</span> <span class="s1">&#39;Palladium&#39;</span><span class="p">,</span> <span class="s1">&#39;Silver&#39;</span><span class="p">,</span> <span class="s1">&#39;Cadmium&#39;</span><span class="p">,</span> <span class="s1">&#39;Indium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Tin&#39;</span><span class="p">,</span> <span class="s1">&#39;Antimony&#39;</span><span class="p">,</span> <span class="s1">&#39;Tellurium&#39;</span><span class="p">,</span> <span class="s1">&#39;Iodine&#39;</span><span class="p">,</span>  <span class="s1">&#39;Xenon&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Cesium&#39;</span><span class="p">,</span> <span class="s1">&#39;Barium&#39;</span><span class="p">,</span> <span class="s1">&#39;Lanthanum&#39;</span><span class="p">,</span> <span class="s1">&#39;Cerium&#39;</span><span class="p">,</span> <span class="s1">&#39;Praseodymium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Neodymium&#39;</span><span class="p">,</span> <span class="s1">&#39;Promethium&#39;</span><span class="p">,</span> <span class="s1">&#39;Samarium&#39;</span><span class="p">,</span> <span class="s1">&#39;Europium&#39;</span><span class="p">,</span> <span class="s1">&#39;Gadolinium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Terbium&#39;</span><span class="p">,</span> <span class="s1">&#39;Dysprosium&#39;</span><span class="p">,</span> <span class="s1">&#39;Holmium&#39;</span><span class="p">,</span> <span class="s1">&#39;Erbium&#39;</span><span class="p">,</span> <span class="s1">&#39;Thulium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Ytterbium&#39;</span><span class="p">,</span> <span class="s1">&#39;Lutetium&#39;</span><span class="p">,</span> <span class="s1">&#39;Hafnium&#39;</span><span class="p">,</span> <span class="s1">&#39;Tantalum&#39;</span><span class="p">,</span> <span class="s1">&#39;Tungsten&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Rhenium&#39;</span><span class="p">,</span> <span class="s1">&#39;Osmium&#39;</span><span class="p">,</span> <span class="s1">&#39;Iridium&#39;</span><span class="p">,</span> <span class="s1">&#39;Platinum&#39;</span><span class="p">,</span> <span class="s1">&#39;Gold&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Mercury&#39;</span><span class="p">,</span> <span class="s1">&#39;Thallium&#39;</span><span class="p">,</span> <span class="s1">&#39;Lead&#39;</span><span class="p">,</span> <span class="s1">&#39;Bismuth&#39;</span><span class="p">,</span> <span class="s1">&#39;Polonium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Astatine&#39;</span><span class="p">,</span> <span class="s1">&#39;Radon&#39;</span><span class="p">,</span> <span class="s1">&#39;Francium&#39;</span><span class="p">,</span> <span class="s1">&#39;Radium&#39;</span><span class="p">,</span> <span class="s1">&#39;Actinium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Thorium&#39;</span><span class="p">,</span> <span class="s1">&#39;Protactinium&#39;</span><span class="p">,</span> <span class="s1">&#39;Uranium&#39;</span><span class="p">,</span>  <span class="s1">&#39;Neptunium&#39;</span><span class="p">,</span> <span class="s1">&#39;Plutonium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Americium&#39;</span><span class="p">,</span> <span class="s1">&#39;Curium&#39;</span><span class="p">,</span> <span class="s1">&#39;Berkelium&#39;</span><span class="p">,</span> <span class="s1">&#39;Californium&#39;</span><span class="p">,</span> <span class="s1">&#39;Einsteinium&#39;</span><span class="p">,</span>
    <span class="s1">&#39;Fermium&#39;</span><span class="p">,</span> <span class="s1">&#39;Mendelevium&#39;</span><span class="p">,</span> <span class="s1">&#39;Nobelium&#39;</span><span class="p">,</span> <span class="s1">&#39;Lawrencium&#39;</span>
<span class="p">]</span>


<div class="viewcode-block" id="numbers_to_symbols"><a class="viewcode-back" href="../../../doc/describe.data.html#describe.data.element_data.numbers_to_symbols">[docs]</a><span class="k">def</span> <span class="nf">numbers_to_symbols</span><span class="p">(</span><span class="n">numbers</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;Given atomic number(s), returns the symbol(s).</span>

<span class="sd">    Args:</span>
<span class="sd">        numbers (int or list of int): Atomic numbers(s) (number of protons).</span>

<span class="sd">    Returns:</span>
<span class="sd">        ndarray: Atomic symbol(s).</span>

<span class="sd">    Raises:</span>
<span class="sd">        ValueError: If a given atomic number is invalid and doesn&#39;t have a</span>
<span class="sd">        corresponding symbol.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">error_msg</span> <span class="o">=</span> <span class="p">(</span>
        <span class="s2">&quot;Given atomic number </span><span class="si">{}</span><span class="s2"> is invalid and doesn&#39;t have a symbol &quot;</span>
        <span class="s2">&quot;associated with it.&quot;</span>
    <span class="p">)</span>
    <span class="n">single_value</span> <span class="o">=</span> <span class="kc">False</span>
    <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">numbers</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int64</span><span class="p">)):</span>
        <span class="n">numbers</span> <span class="o">=</span> <span class="p">[</span><span class="n">numbers</span><span class="p">]</span>
        <span class="n">single_value</span> <span class="o">=</span> <span class="kc">True</span>
    <span class="n">symbols</span> <span class="o">=</span> <span class="p">[]</span>
    <span class="k">for</span> <span class="n">number</span> <span class="ow">in</span> <span class="n">numbers</span><span class="p">:</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="n">symbol</span> <span class="o">=</span> <span class="n">NUMBER_TO_SYMBOL_MAP</span><span class="p">[</span><span class="n">number</span><span class="p">]</span>
        <span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">error_msg</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">number</span><span class="p">))</span>
        <span class="k">if</span> <span class="n">symbol</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">error_msg</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">number</span><span class="p">))</span>
        <span class="n">symbols</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">symbol</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">symbols</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">if</span> <span class="n">single_value</span> <span class="k">else</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">symbols</span><span class="p">)</span></div>


<div class="viewcode-block" id="symbols_to_numbers"><a class="viewcode-back" href="../../../doc/describe.data.html#describe.data.element_data.symbols_to_numbers">[docs]</a><span class="k">def</span> <span class="nf">symbols_to_numbers</span><span class="p">(</span><span class="n">symbols</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;Given element symbol(s), return the atomic number(s) (number of protons).</span>

<span class="sd">    Args:</span>
<span class="sd">        symbols (str or list of str): Atomic symbol(s).</span>

<span class="sd">    Returns:</span>
<span class="sd">        ndarray: Atomic number(s) (number of protons).</span>

<span class="sd">    Raises:</span>
<span class="sd">        ValueError: If a given atomic symbol is invalid and doesn&#39;t have a</span>
<span class="sd">        corresponding number.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">single_value</span> <span class="o">=</span> <span class="kc">False</span>
    <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">symbols</span><span class="p">,</span> <span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">str_</span><span class="p">)):</span>
        <span class="n">symbols</span> <span class="o">=</span> <span class="p">[</span><span class="n">symbols</span><span class="p">]</span>
        <span class="n">single_value</span> <span class="o">=</span> <span class="kc">True</span>
    <span class="n">numbers</span> <span class="o">=</span> <span class="p">[]</span>
    <span class="k">for</span> <span class="n">symbol</span> <span class="ow">in</span> <span class="n">symbols</span><span class="p">:</span>
        <span class="n">number</span> <span class="o">=</span> <span class="n">SYMBOL_TO_NUMBER_MAP</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">symbol</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">number</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
                <span class="s2">&quot;Given atomic symbol </span><span class="si">{}</span><span class="s2"> is invalid and doesn&#39;t have a number &quot;</span>
                <span class="s2">&quot;associated with it.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">symbol</span><span class="p">)</span>
            <span class="p">)</span>
        <span class="n">numbers</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">number</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">numbers</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">if</span> <span class="n">single_value</span> <span class="k">else</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">numbers</span><span class="p">)</span></div>
</pre></div>

           </div>
           
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright .

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../../../',
            VERSION:'0.1.0',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="../../../_static/jquery.js"></script>
      <script type="text/javascript" src="../../../_static/underscore.js"></script>
      <script type="text/javascript" src="../../../_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  <script type="text/javascript" src="../../../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>